
package gs.eisenhower.swallet.factory;

import gs.eisenhower.swallet.ui_component.EarningsFragment;
import gs.eisenhower.swallet.ui_component.ExpendituresFragment;
import gs.eisenhower.swallet.ui_component.HistoryFragment;
import gs.eisenhower.swallet.ui_component.ReportsFragment;
import android.app.Fragment;

/**
 * FragmentFactory creates fragments based on provided data.
 *  
 * @author Stefan Godoroja
 */
public class FragmentFactory {
	private static final FragmentFactory fragmentFactory = new FragmentFactory();
	
	private FragmentFactory() {}
	
	public static FragmentFactory getInstance() {
		return fragmentFactory;
	}
	
	public Fragment getFragment(int tabId) {
		switch (tabId) {
		case 0:
			return new ExpendituresFragment();
		case 1:
			return new EarningsFragment();
		case 2:
			return new ReportsFragment();
		case 3:
			return new HistoryFragment();
		default:
			return null;
		}
	}
}
